import request from '@/utils/request'

export function listPermission(query) {
  return request({
    url: '/sys/permission/list',
    method: 'get',
    params: query
  })
}

export function createPermission(data) {
  return request({
    url: '/sys/permission/create',
    method: 'post',
    data
  })
}

export function readPermission(data) {
  return request({
    url: '/sys/permission/read/' + data.id,
    method: 'get'
  })
}

export function updatePermission(data) {
  return request({
    url: '/sys/permission/update',
    method: 'post',
    data
  })
}

export function deletePermission(data) {
  return request({
    url: '/sys/permission/delete/' + data.id,
    method: 'delete'
  })
}

export function permissionOptions(query) {
  return request({
    url: '/sys/permission/options',
    method: 'get',
    params: query
  })
}
